package com.sui.bigdata.sml.model.util;

/**
 * @author songhaicheng
 * @date 2019/12/4 13:57
 * @description 支持的模型类型
 * @reviewer
 */
public enum ModelType {
    /**
     * Spark PipelineModel
     */
    SPARK("spark"),
    /**
     * PMML
     */
    PMML("pmml"),
    /**
     * MLEAP
     */
    MLEAP("mleap"),
    /**
     * Tensorflow Protobuf
     */
    TENSORFLOW("tensorflow");

    private final String value;

    ModelType(String value) {
        this.value = value;
    }

    public String getValue() {
        return this.value;
    }

    public static ModelType getModelType(String candidate) {
        if (candidate == null) {
            return null;
        }
        for (ModelType type : values()) {
            if (type.getValue().equals(candidate.toLowerCase())) {
                return type;
            }
        }
        return null;
    }

}
